<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<div class="navbar-custom-menu">
    <ul class="nav navbar-nav">
        <li>
            <div class="input-group" style="width: 285px;margin-top: 8px">
                <input id="keyword" type="text" class="form-control"
                       style="border-bottom-left-radius: 100px;border-top-left-radius: 100px;border-right: none"
                       placeholder="设备名称，型号，序列号" value="${keyword}">
                <span class="input-group-btn">
            <a class="btn btn-default" style="border-radius: 0;padding: 6px" title="重置" onclick="resetKeyword()">
              <i class='fa fa-remove'></i>
            </a>
            <a class="btn btn-default" style="border-bottom-right-radius: 100px;border-top-right-radius: 100px;"
                 title="搜素" href=" javascript:searchDevice()">
              <i class='fa fa-search'></i>
            </a>
          </span>
            </div>
        </li>
        <!-- Control Sidebar Toggle Button -->
        <li>
            <a href="#" data-toggle="control-sidebar" onclick="rightMenu()"><i class="fa fa-ellipsis-h"></i></a>
        </li>
    </ul>
</div>

<script src="<%=basePath%>/js/overallSituation.js"></script>

<script type="text/javascript">
        function searchDevice(){
            var keyword = $("#keyword").val();
            if(keyword == null || keyword == ""){
                flavrShowByTime("请输入搜索关键字",null,"danger",false);
                return;
            }
            location.href="<%=basePath%>/device/searchDevice?keyword="+keyword
        }

        function resetKeyword(){
            $("#keyword").val("");
        }
</script>